package com.intellij.ide.license;

import com.intellij.ide.license.idea.IdeaLicenseManager;
import com.intellij.openapi.application.ex.ApplicationInfoEx;

import java.math.BigInteger;
import java.util.Date;

public abstract class LicenseManager {
    private static LicenseManager licenseManager;

    public static LicenseManager getInstance() {
        if (licenseManager == null) {
            licenseManager = new IdeaLicenseManager();
        }
        return licenseManager;
    }

    public static void setInstance(LicenseManager lm) {
        if (licenseManager == null) {
            licenseManager = lm;
        }
    }

    public abstract boolean supportsRegistration();

    public abstract void register();

    public abstract void startUp(StartupAction action);

    public abstract String licensedToMessage();

    public abstract String licensedRestrictionsMessage();

    public abstract LicenseFactory createLicenseFactory();

    public abstract LicenseFactory doGetLicenseFactory();

    public abstract boolean isEvaluationLicense();

    public abstract Date getExpirationDate();

    public abstract boolean j();

    public boolean isEAP() {
        return ApplicationInfoEx.getInstanceEx().isEAP();
    }

    public boolean l() {
        return false;
    }

    public boolean m() {
        return false;
    }

    public void n() {
        throw new UnsupportedOperationException();
    }

    public abstract boolean o();

    public void p() {
        throw new UnsupportedOperationException();
    }

    public boolean q() {
        return isEvaluationLicense();
    }

    public String encode(BigInteger paramBigInteger) {
        return "0";
    }

    public Date getUpgradeDueDate() {
        return null;
    }

    public LicenseSource getLicenseSource() {
        return null;
    }

    public static interface StartupAction {

        void proceed();

        void cancel();
    }
}
